//
//  LoginView.m
//  01-UIViewHomeWork
//
//  Created by LL.F on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "LoginView.h"

@interface LoginView ()
@property (nonatomic, strong) UITextField *rightTextField;
@property (nonatomic, strong) UIButton *leftButton;

@end
@implementation LoginView

- (instancetype)initWithFrame:(CGRect)frame
{

    self = [super initWithFrame:frame];
    if (self) {
        
        //左侧用户名button
        self.leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
        _leftButton.frame = CGRectMake(0, 0, self.frame.size.width / 8, self.frame.size.height);
        [_leftButton setImage:[[UIImage imageNamed:@"icon_username"] imageWithRenderingMode:1]forState:UIControlStateNormal];
        _leftButton.backgroundColor = [UIColor blackColor];
        _leftButton.alpha = 0.5;
        [self addSubview:_leftButton];
        
        //右侧用户名textField
        self.rightTextField = [[UITextField alloc] initWithFrame:CGRectMake(self.leftButton.frame.size.width, 0, self.frame.size.width - self.leftButton.frame.size.width, self.frame.size.height)];
        _rightTextField.placeholder = @" 请输入已验证手机号或邮箱";
        self.rightTextField.backgroundColor = [UIColor blackColor];
        [_rightTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
        _rightTextField.alpha = 0.3;
        
//        _rightTextField.textColor = [UIColor whiteColor];
//        _rightTextField.font = [UIFont systemFontOfSize:13];
        [self addSubview:_rightTextField];
        
               
    }
    return self;
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
